from django.conf.urls import patterns, url

urlpatterns = patterns('',
        # This url will show the home page
        url(r'^home/$',                                 'yaasapp.views.home'),
        # This url will redirect to the home page and will sort the table data according to the sort type passed
        url(r'^home/(?P<sort_order>\w+)/$',             'yaasapp.views.home'),
        # This url will direct the user to login page
        url(r'^login/$',                                'yaasapp.views.login_view'),
        # This url will log out the currently logged in user.
        url(r'^logout/$',                               'yaasapp.views.logout_view'),
        # This url will direct the user to the create new auction page.
        url(r'^create/$',                               'yaasapp.views.newAuction'),
        # This url will direct the user to the add new user page
        url(r'^adduser/$',                              'yaasapp.views.register_user'),
        # This url will direct the user to the update the logged in user info
        url(r'^updateuser/$',                           'yaasapp.views.updateUser'),
        #This url will save the auction created
        url(r'^saveauction/$',                          'yaasapp.views.saveAuction'),
        #This url will direct the user to the page where it shows the detail of item whose id was passed along with it
        url(r'^item/(\d{1,3})/$',                       'yaasapp.views.itemDetail'),
        #This url will direct the user to the edit item page where the user have to pass the id of the item
        url(r'^edititem/(?P<id>\d+)/$',                 'yaasapp.views.edit_item'),
        # To use this url you need to login as a admin
        url(r'^banauction/(?P<id>\d+)/$',               'yaasapp.views.banAuction'),
        # To url is used to switch between the desired language.
        url(r'^language/(?P<lan>\w+)/$',                'yaasapp.views.language'),
        # To use api in order to get all the auction data in Json format
        (r'^api/auc/$',                                 'yaasapp.rest_views.auc_list'),
        # To use api in order to get particular auction data in Json format
        (r'^api/auc/(?P<pk>\d+)/$',                     'yaasapp.rest_views.auc_list'),
        # To use api in order to bid the on the auction required auction data are sent in JSON format.
        (r'^api/bidauc/(?P<id>\d+)/$',                  'yaasapp.rest_views.auc_bid'),
        # This url will create the desired number of user and auction data(maximum 50)
        # this url also deletes all the previous data stored in the user and auction table so
        # use it only if you dont want your previous data.
        (r'^createaucuser/(?P<num>\d+)/$',              'yaasapp.DataGeneration.newAuction'),
)